package pl.egraveyard.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.validation.BindException;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractCommandController;

import pl.egraveyard.command.MainPageCommand;
import pl.egraveyard.util.Constants;

/**
 * Kontroler dla widoku strony glownej
 * @author gunos
 *
 */
public class MainPageController extends AbstractCommandController{
	private static final String FTL = "/main_page";
	
	/**
	 * Domyslny konstruktor
	 */
	public MainPageController(){
		this.setCommandClass(MainPageCommand.class);
		this.setCommandName(Constants.CMD_OBJ);
	}
	
	/**
	 * {@inheritDoc}
	 */
	@Override
	protected ModelAndView handle(final HttpServletRequest request,
			final HttpServletResponse response, final Object command,
			final BindException errors) throws Exception {
		return new ModelAndView(FTL);
	}

}
